from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QTreeView, QFileSystemModel
from PyQt5.QtCore import Qt

class FileBrowser(QWidget):
    def __init__(self):
        super().__init__()

        self.model = QFileSystemModel()
        self.model.setRootPath('')
        self.tree = QTreeView()
        self.tree.setModel(self.model)
        self.tree.setRootIndex(self.model.index('./'))

        self.tree.clicked.connect(self.on_clicked)

        layout = QVBoxLayout()
        layout.addWidget(self.tree)
        self.setLayout(layout)

    def on_clicked(self, index):
        print(self.model.filePath(index))

app = QApplication([])
browser = FileBrowser()
browser.show()
app.exec_()

from PyQt5.QtWidgets import QApplication, QMainWindow, QTreeView, QVBoxLayout, QWidget, QItemSelectionModel

